
> #### Replication script for analyses in "Trade and Redistribution: Trade Politics and the Origins of Redistributive Taxation"
> 
> # log to file: 
> .... [TRUNCATED] 

> library(compactr)

> library(clusterSEs)

> library(multiwayvcov)

> library(lmtest)

> library(erer)

> library(MASS)

> library(foreign)

> library(mvtnorm)

> set.seed(12345)

> ## define inverse logit function
> 
> inv.logit <- function(p) {
+   return(exp(p)/(1+exp(p)))
+ }

> #### Macro Comparative Analyses: Tables 1 & 2; figures 3 & 4
> 
> ####### Load data
> load("trade_redist_macro_tscs.RData") # data is called macro

> ####### Table 1
> 
> market.empty = lm(market ~ l1.tradeallyadv + l1rural.ineq + l1.lta.ineq 
+                   + as.factor(country_name) + as.fac .... [TRUNCATED] 

> market.preferred = lm(market ~ l1.tradeallyadv + l1rural.ineq + l1.lta.ineq
+                       + l1.e2 + l1.trade + l1.rgdppc + votetax2
+      .... [TRUNCATED] 

> market.full = lm(market ~ l1.tradeallyadv + l1rural.ineq + l1.lta.ineq
+                  + l1.e2 + l1.trade + l1.rgdppc + votetax2 + l1.taxgdp
+    .... [TRUNCATED] 

> market.no.int.preferred = lm(market ~ l1.tradeallyadv + l1rural.ineq
+                              + l1.e2 + l1.trade + l1.rgdppc + votetax2
+      .... [TRUNCATED] 

> direct.empty = lm(direct~ l1.tradeallyadv + l1rural.ineq + l1.lta.ineq 
+                   + as.factor(country_name) + as.factor(year), data = macr .... [TRUNCATED] 

> direct.preferred = lm(direct ~ l1.tradeallyadv + l1rural.ineq + l1.lta.ineq
+                       + l1.e2 + l1.trade + l1.rgdppc + votetax2
+      .... [TRUNCATED] 

> direct.no.int.preferred = lm(direct ~ l1.tradeallyadv + l1rural.ineq
+                              + l1.e2 + l1.trade + l1.rgdppc + votetax2
+      .... [TRUNCATED] 

> direct.full = lm(direct ~ l1.tradeallyadv + l1rural.ineq + l1.lta.ineq
+                  + l1.e2 + l1.trade + l1.rgdppc + votetax2 + l1.taxgdp
+    .... [TRUNCATED] 

> stargazer(market.empty, market.preferred, market.full, direct.empty, direct.preferred,direct.full, omit = c("year", "country", "Constant")
+         .... [TRUNCATED] 

The determinants of revenue shares in total taxation, 1870-1913
-----------------------------------------------------------------------------------
                              Domestic Indirect Share          Direct Share        
                             Model 1  Model 2  Model 3  Model 4   Model 5  Model 6 
-----------------------------------------------------------------------------------
Labour trade advantage (LTA)  -0.16  -0.76***  -0.52**   -0.04    0.79***  0.49*** 
                             (0.17)   (0.17)    (0.21)   (0.13)   (0.12)    (0.14) 
Inequality                    -0.10  -0.57***  -0.50**  -1.10*** -0.34***  -0.48***
                             (0.14)   (0.16)    (0.20)   (0.11)   (0.11)    (0.13) 
LTA : inequality             0.53**   1.58***  1.29***   -0.04   -1.51***  -1.09***
                             (0.25)   (0.27)    (0.33)   (0.19)   (0.19)    (0.22) 
GDP per capita                        0.0000    0.0000           0.0000***  0.0000 
                                     (0.0000)  (0.0000)          (0.0000)  (0.0000)
Vote-tax link                        -0.07***  -0.07***          -0.05***  -0.04***
                                      (0.02)    (0.02)            (0.01)    (0.01) 
Economic franchise                   -0.04***   -0.01             -0.003     0.01  
                                      (0.02)    (0.04)            (0.01)    (0.03) 
Trade                                -27.96***  10.37            25.53***   -2.02  
                                      (4.92)   (14.12)            (3.43)    (9.35) 
Tax/GDP                                        -0.01**                      0.01*  
                                               (0.004)                     (0.003) 
Country fixed effects           Y        Y        Y        Y         Y        Y    
Year fixed effects              Y        Y        Y        Y         Y        Y    
N                              425      380      306      425       380      306   
R-squared                     0.94     0.96      0.96     0.95     0.97      0.97  
Adj. R-squared                0.94     0.95      0.95     0.94     0.96      0.96  
-----------------------------------------------------------------------------------
***p < .01; **p < .05; *p < .1                                                     

> ##### Table 2 -- top tax rates
> ytax.empty = lm(top_incrate_n ~ l1.tradeallyadv + l1rural.ineq + l1.lta.ineq
+                 + as.factor(country_ .... [TRUNCATED] 

> ytax.preferred = lm(top_incrate_n ~ l1.tradeallyadv + l1rural.ineq + l1.lta.ineq
+                     + l1.e2 + l1.trade + l1.rgdppc + votetax2
+   .... [TRUNCATED] 

> ytax.preferred.noint = lm(top_incrate_n ~ l1.tradeallyadv + l1rural.ineq 
+                           + l1.e2 + l1.trade + l1.rgdppc + votetax2
+    .... [TRUNCATED] 

> ytax.full = lm(top_incrate_n ~ l1.tradeallyadv + l1rural.ineq + l1.lta.ineq
+                + l1.e2 + l1.trade + l1.rgdppc + votetax2 + l1.taxgdp
+ .... [TRUNCATED] 

> htax.empty = lm(topitaxrate2 ~ l1.tradeallyadv + l1rural.ineq + l1.lta.ineq
+                 + as.factor(country_name) + as.factor(year), data = ma .... [TRUNCATED] 

> htax.preferred = lm(topitaxrate2 ~ l1.tradeallyadv + l1rural.ineq + l1.lta.ineq
+                     + l1.e2 + l1.trade + l1.rgdppc + votetax2
+    .... [TRUNCATED] 

> htax.full = lm(topitaxrate2 ~ l1.tradeallyadv + l1rural.ineq + l1.lta.ineq
+                + l1.e2 + l1.trade + l1.rgdppc + votetax2 + l1.taxgdp
+  .... [TRUNCATED] 

> stargazer(ytax.empty, ytax.preferred, ytax.full, htax.empty, htax.preferred, htax.full, omit = c("year", "country", "Constant")
+           , type = .... [TRUNCATED] 

The determinants of top direct tax rates, 1870-1913
----------------------------------------------------------------------------------------
                                  Top Income Tax Rate        Top Inheritance Tax Rate   
                              Model 1   Model 2   Model 3   Model 4   Model 5   Model 6 
----------------------------------------------------------------------------------------
Labour trade advantage (LTA)   1.86      -3.04   -11.72**  25.13***  15.76***    8.94   
                              (4.83)    (4.95)    (5.89)    (4.16)    (4.69)    (5.93)  
Inequality                   -20.66*** -32.79*** -33.85***   -1.42   -12.65*** -17.22***
                              (4.16)    (4.66)    (5.56)    (3.58)    (4.42)    (5.60)  
LTA : inequality               0.52      8.15     22.00**  -45.63*** -30.02***  -18.32* 
                              (7.32)    (7.74)    (9.27)    (6.30)    (7.34)    (9.33)  
GDP per capita                         -0.001*** -0.001***           -0.001*** -0.002***
                                       (0.0003)  (0.0004)            (0.0003)  (0.0004) 
Vote-tax link                          -3.99***  -2.78***              -0.51     0.16   
                                        (0.48)    (0.56)              (0.45)    (0.56)  
Economic franchise                       -0.30    3.47***              -0.53     1.30   
                                        (0.44)    (1.23)              (0.41)    (1.24)  
Trade                                  308.99**   -518.67            -264.91** -731.99* 
                                       (134.47)  (397.43)            (127.51)  (400.24) 
Tax/GDP                                            0.11                          -0.18  
                                                  (0.12)                        (0.12)  
Country fixed effects            Y         Y         Y         Y         Y         Y    
Year fixed effects               Y         Y         Y         Y         Y         Y    
N                               397       386       306       397       386       306   
R-squared                      0.90      0.92      0.93      0.88      0.88      0.89   
Adj. R-squared                 0.88      0.90      0.91      0.85      0.86      0.87   
----------------------------------------------------------------------------------------
***p < .01; **p < .05; *p < .1                                                          

> ### Figure 3
> ## figure 3a
> beta.hat <- coef(market.preferred)

> # pull out the covariance matrix
> cov <- vcov(market.preferred)

> # a set of values of z to compute the (instantaneous)
> # effect of x
> z0 <- seq(min(market.preferred$model$l1rural.ineq), max(market.preferred$mod .... [TRUNCATED] 

> # calculate the instantaneous effect of x as z varies
> dy.dx <- beta.hat["l1.tradeallyadv"] + beta.hat["l1.lta.ineq"]*z0

> # calculate the standard error of each estimated effect
> se.dy.dx <- sqrt(cov["l1.tradeallyadv", "l1.tradeallyadv"] + z0^2*cov["l1.lta.ineq", "l1.l ..." ... [TRUNCATED] 

> # calculate upper and lower bounds of a 95% CI
> upr <- dy.dx + 1.96*se.dy.dx

> lwr <- dy.dx - 1.96*se.dy.dx

> # plot the ME using compactr
> #par(mfrow = c(1,1))
> par(mar = c(4,5,2,2)+0.4)

> plot(density(market.preferred$model$l1rural.ineq), type = "l",  xlim = mm(market.preferred$model$l1rural.ineq), yaxt = "n", xaxt = "n", ylab = "", x .... [TRUNCATED] 

> dens = density(market.preferred$model$l1rural.ineq)

> mnri = min(market.preferred$model$l1rural.ineq, na.rm = T)

> mxri = max(market.preferred$model$l1rural.ineq, na.rm = T)

> x1 = min(which(dens$x > mnri))  

> x2 = max(which(dens$x < mxri))  

> with(dens, polygon(x=c(x[c(x1,x1:x2,x2)]), y= c(0, y[x1:x2], 0), col="gray85", border = "gray85"))

> par(new = T)

> plot(z0, dy.dx, lwd = 3, type = "l", xlim = mm(market.preferred$model$l1rural.ineq), ylim = mm(c(upr, lwr)),
+      xlab = "Inequality",
+      ylab .... [TRUNCATED] 

> abline(h = 0, col = "grey60", lty = 2)

> #lines(z0, dy.dx, lwd = 3)
> lines(z0, lwr, lty = 3)

> lines(z0, upr, lty = 3)

> dev.print(device = pdf, file = "figure_3a.pdf", height = 6, width = 6)
RStudioGD 
        2 

> ## figure 3b
> beta.hat <- coef(direct.preferred)

> # pull out the covariance matrix
> cov <- vcov(direct.preferred)

> # a set of values of z to compute the (instantaneous)
> # effect of x
> z0 <- seq(min(direct.preferred$model$l1rural.ineq), max(direct.preferred$mod .... [TRUNCATED] 

> # calculate the instantaneous effect of x as z varies
> dy.dx <- beta.hat["l1.tradeallyadv"] + beta.hat["l1.lta.ineq"]*z0

> # calculate the standard error of each estimated effect
> se.dy.dx <- sqrt(cov["l1.tradeallyadv", "l1.tradeallyadv"] + z0^2*cov["l1.lta.ineq", "l1.l ..." ... [TRUNCATED] 

> # calculate upper and lower bounds of a 95% CI
> upr <- dy.dx + 1.96*se.dy.dx

> lwr <- dy.dx - 1.96*se.dy.dx

> # plot 
> par(mar = c(4,5,2,2)+0.4)

> plot(density(direct.preferred$model$l1rural.ineq), type = "l",  xlim = mm(direct.preferred$model$l1rural.ineq), yaxt = "n", xaxt = "n", ylab = "", x .... [TRUNCATED] 

> dens = density(direct.preferred$model$l1rural.ineq)

> mnri = min(direct.preferred$model$l1rural.ineq, na.rm = T)

> mxri = max(direct.preferred$model$l1rural.ineq, na.rm = T)

> x1 = min(which(dens$x > mnri))  

> x2 = max(which(dens$x < mxri))  

> with(dens, polygon(x=c(x[c(x1,x1:x2,x2)]), y= c(0, y[x1:x2], 0), col="gray85", border = "gray85"))

> par(new = T)

> plot(z0, dy.dx, lwd = 3, type = "l", xlim = mm(direct.preferred$model$l1rural.ineq), ylim = mm(c(upr, lwr)),
+      xlab = "Inequality",
+      ylab .... [TRUNCATED] 

> abline(h = 0, col = "grey60", lty = 2)

> #lines(z0, dy.dx, lwd = 3)
> lines(z0, lwr, lty = 3)

> lines(z0, upr, lty = 3)

> dev.print(device = pdf, file = "figure_3b.pdf", height = 6, width = 6)
RStudioGD 
        2 

> ###### Figure 4
> ###### Figure 4a:
> beta.hat <- coef(ytax.preferred)

> # pull out the covariance matrix
> cov <- vcov(ytax.preferred)

> # a set of values of z to compute the (instantaneous)
> # effect of x
> z0 <- seq(min(ytax.preferred$model$l1rural.ineq), max(ytax.preferred$model$l .... [TRUNCATED] 

> # calculate the instantaneous effect of x as z varies
> dy.dx <- beta.hat["l1.tradeallyadv"] + beta.hat["l1.lta.ineq"]*z0

> # calculate the standard error of each estimated effect
> se.dy.dx <- sqrt(cov["l1.tradeallyadv", "l1.tradeallyadv"] + z0^2*cov["l1.lta.ineq", "l1.l ..." ... [TRUNCATED] 

> # calculate upper and lower bounds of a 95% CI
> upr <- dy.dx + 1.96*se.dy.dx

> lwr <- dy.dx - 1.96*se.dy.dx

> # plot the ME using compactr
> 
> #par(mfrow = c(1,1))
> par(mar = c(4,5,2,2)+0.4)

> plot(density(ytax.preferred$model$l1rural.ineq), type = "l",  xlim = mm(ytax.preferred$model$l1rural.ineq), yaxt = "n", xaxt = "n", ylab = "", xlab  .... [TRUNCATED] 

> dens = density(ytax.preferred$model$l1rural.ineq)

> mnri = min(ytax.preferred$model$l1rural.ineq, na.rm = T)

> mxri = max(ytax.preferred$model$l1rural.ineq, na.rm = T)

> x1 = min(which(dens$x > mnri))  

> x2 = max(which(dens$x < mxri))  

> with(dens, polygon(x=c(x[c(x1,x1:x2,x2)]), y= c(0, y[x1:x2], 0), col="gray85", border = "gray85"))

> par(new = T)

> plot(z0, dy.dx, lwd = 3, type = "l", xlim = mm(ytax.preferred$model$l1rural.ineq), ylim = mm(c(upr, lwr)),
+      xlab = "Inequality",
+      ylab = .... [TRUNCATED] 

> abline(h = 0, col = "grey60", lty = 2)

> #lines(z0, dy.dx, lwd = 3)
> lines(z0, lwr, lty = 3)

> lines(z0, upr, lty = 3)

> dev.print(device = pdf, file = "figure_4a.pdf", height = 6, width = 6)
RStudioGD 
        2 

> ##### Figure 4b
> beta.hat <- coef(htax.preferred)

> # pull out the covariance matrix
> cov <- vcov(htax.preferred)

> # a set of values of z to compute the (instantaneous)
> # effect of x
> z0 <- seq(min(htax.preferred$model$l1rural.ineq), max(htax.preferred$model$l .... [TRUNCATED] 

> # calculate the instantaneous effect of x as z varies
> dy.dx <- beta.hat["l1.tradeallyadv"] + beta.hat["l1.lta.ineq"]*z0

> # calculate the standard error of each estimated effect
> se.dy.dx <- sqrt(cov["l1.tradeallyadv", "l1.tradeallyadv"] + z0^2*cov["l1.lta.ineq", "l1.l ..." ... [TRUNCATED] 

> # calculate upper and lower bounds of a 95% CI
> upr <- dy.dx + 1.96*se.dy.dx

> lwr <- dy.dx - 1.96*se.dy.dx

> par(mar = c(4,5,2,2)+0.4)

> plot(density(htax.preferred$model$l1rural.ineq), type = "l",  xlim = mm(htax.preferred$model$l1rural.ineq), yaxt = "n", xaxt = "n", ylab = "", xlab  .... [TRUNCATED] 

> dens = density(htax.preferred$model$l1rural.ineq)

> mnri = min(htax.preferred$model$l1rural.ineq, na.rm = T)

> mxri = max(htax.preferred$model$l1rural.ineq, na.rm = T)

> x1 = min(which(dens$x > mnri))  

> x2 = max(which(dens$x < mxri))  

> with(dens, polygon(x=c(x[c(x1,x1:x2,x2)]), y= c(0, y[x1:x2], 0), col="gray85", border = "gray85"))

> par(new = T)

> plot(z0, dy.dx, lwd = 3, type = "l", xlim = mm(htax.preferred$model$l1rural.ineq), ylim = mm(c(upr, lwr)),
+      xlab = "Inequality",
+      ylab = .... [TRUNCATED] 

> abline(h = 0, col = "grey60", lty = 2)

> #lines(z0, dy.dx, lwd = 3)
> lines(z0, lwr, lty = 3)

> lines(z0, upr, lty = 3)

> dev.print(device = pdf, file = "figure_4b.pdf", height = 6, width = 6)
RStudioGD 
        2 

> ############## British Data
> load("trade_redist_brit_constit.RData") ## data is called britcon

> ## Table 3 and Figure 5: ease of Labour entry
> 
> ### models
> 
> ease1ft = polr(labelease ~ trade.gen.f + contest1900 + cvs1900.2+ cvs1900.22, met .... [TRUNCATED] 

> ease2ft = polr(labelease ~ trade.gen.f + contest1900 + cvs1900.2 + cvs1900.22+ scotland, method = "logistic", data = britcon)

> ease3ft = polr(labelease ~ trade.gen.f + lb.socec + contest1900 + cvs1900.2+ cvs1900.22 + scotland, method = "logistic", data = britcon, Hess = T)

> ease4ft = polr(labelease ~ trade.gen.f + lb.socec + double + d.type + contest1900 + cvs1900.2 + cvs1900.22+ scotland, method = "logistic", data = br .... [TRUNCATED] 

> ease5ft = polr(labelease ~ trade.gen.f + lb.socec + double + d.type + industrial.f+ contest1900 + cvs1900.2+ cvs1900.22 + scotland, method = "logist ..." ... [TRUNCATED] 

> ## print table to console (see Table 3)
> stargazer(ease1ft, ease2ft, ease3ft, ease4ft, ease5ft
+           , style = "ajps"
+           , title="Ea ..." ... [TRUNCATED] 

Ease of labor election in 1906. Model 4 provides estimates for figure~5
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                                                                                                 Dependent variable: ordered factor.                                                  
                                                         Model 1                    Model 2                    Model 3                    Model 4                    Model 5          
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Free trade                                               1.49***                    1.86***                    1.98***                    2.32***                    2.29***          
                                                         (0.18)                      (0.17)                     (0.16)                     (0.16)                     (0.19)          
Neutral trade                                            0.57***                    0.59***                    0.77***                    0.61***                    1.19***          
                                                         (0.21)                      (0.19)                     (0.17)                     (0.15)                     (0.16)          
Double member                                                                                                                             2.77***                    2.45***          
                                                                                                                                           (0.35)                     (0.38)          
County                                                                                                                                    -1.88***                   -1.35***         
                                                                                                                                           (0.37)                     (0.39)          
Mixed class                                                                                                    2.19***                    2.98***                    2.17***          
                                                                                                                (0.15)                     (0.18)                     (0.18)          
Working class                                                                                                  2.47***                    3.47***                    2.22***          
                                                                                                                (0.13)                     (0.18)                     (0.18)          
Industrial                                                                                                                                                           2.13***          
                                                                                                                                                                      (0.25)          
Part-industrial                                                                                                                                                      3.09***          
                                                                                                                                                                      (0.19)          
Election 1900: Liberal                                  -3.30***                    -3.81***                   -5.23***                   -8.88***                   -8.23***         
                                                         (0.30)                      (0.30)                     (0.30)                     (0.35)                     (0.33)          
Election 1900: Conservative                             -2.08***                    -2.76***                   -3.94***                   -6.71***                   -5.96***         
                                                         (0.25)                      (0.25)                     (0.25)                     (0.30)                     (0.31)          
Election 1900: Neither                                  -1.76***                    -2.28***                   -3.69***                   -6.29***                   -5.78***         
                                                         (0.41)                      (0.33)                     (0.34)                     (0.33)                     (0.33)          
Cons. vote 1900                                         -0.10***                    -0.12***                   -0.19***                   -0.34***                   -0.34***         
                                                         (0.03)                      (0.03)                     (0.03)                     (0.03)                     (0.03)          
Cons. vote 1900 squared                                   0.001                      0.001*                    0.002***                   0.003***                   0.004***         
                                                         (0.001)                    (0.001)                    (0.0005)                   (0.001)                    (0.001)          
Scotland                                                                            -1.36***                   -1.36***                   -1.61***                   -1.13***         
                                                                                     (0.24)                     (0.21)                     (0.49)                     (0.41)          
N                                                          556                        556                        556                        556                        556            
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
***p < .01; **p < .05; *p < .1                                                                                                                                                        
Variables beginning `Election' indicate constituencies contested by only one, or neither, of the major parties -- the omitted category contains Lib-Con contested constituencies.     

> ## Create marginal effects for Figure
> ease1ftmfx = ocME(ease1ft)

> ease2ftmfx = ocME(ease2ft)

> ease3ftmfx = ocME(ease3ft)

> ease4ftmfx = ocME(ease4ft)

> ease5ftmfx = ocME(ease5ft)

> locbarsft = barplot(ease4ftmfx$out$ME.0[,1], horiz = T, beside = T, las = 2)

> lowerft0 = ease4ftmfx$out$ME.0[,1] - 1.96*ease4ftmfx$out$ME.0[,2]

> upperft0 = ease4ftmfx$out$ME.0[,1] + 1.96*ease4ftmfx$out$ME.0[,2]

> lowerft1 = ease4ftmfx$out$ME.1[,1] - 1.96*ease4ftmfx$out$ME.1[,2]

> upperft1 = ease4ftmfx$out$ME.1[,1] + 1.96*ease4ftmfx$out$ME.1[,2]

> lowerft2 = ease4ftmfx$out$ME.2[,1] - 1.96*ease4ftmfx$out$ME.2[,2]

> upperft2 = ease4ftmfx$out$ME.2[,1] + 1.96*ease4ftmfx$out$ME.2[,2]

> plotorder4ft = c(12, 11, 10, 9, 8, 7, 4, 3, 6, 5, 1, 2)

> plotnames4ft = c("Scotland", "Cons. vote 1900^2", "Cons. vote 1900", "Election 1900: Neither", "Election 1900: Cons.", "Election 1900: Liberal", "Wo ..." ... [TRUNCATED] 

> par(mar = c(2.5, 0.7, 1, 0.8)+0.2, mfrow = c(1,3), oma = c(3, 10.5, 3, 0))

> ## Three-panel plot, Figure 5
> plot(ease4ftmfx$out$ME.0[plotorder4ft,1], locbarsft, pch = 18, xlim = c(-0.6, 0.4), yaxt = "n", xlab = "", ylab = "" .... [TRUNCATED] 

> abline(v = 0, col = "grey")

> segments(x0 = lowerft0[plotorder4ft], x1 = upperft0[plotorder4ft], y0 = locbarsft)

> #mtext(text = rownames(ease4mfx$out$ME.0)[plotorder4ft], at = locbars, line = 1, side =2, las = 2)
> mtext(text = plotnames4ft, at = locbarsft, line .... [TRUNCATED] 

> mtext("No Labor \n Candidate", side = 3, line = 1, font = 3, cex = 0.8)

> plot(ease4ftmfx$out$ME.1[plotorder4ft,1], locbarsft, pch = 18, xlim = c(-0.6, 0.4), yaxt = "n", xlab = "", ylab = "")

> abline(v = 0, col = "grey")

> segments(x0 = lowerft1[plotorder4ft], x1 = upperft1[plotorder4ft], y0 = locbarsft)

> mtext("Labor Candidate, \n Opposed", side = 3, line = 1, font = 3, cex = 0.8)

> mtext("Marginal effect of unit change \n Calculated at mean of independent variables", side = 1, outer = T, line = 1.5, cex = 0.8)

> plot(ease4ftmfx$out$ME.2[plotorder4ft,1], locbarsft, pch = 18, xlim = c(-0.6, 0.4), yaxt = "n", xlab = "", ylab = "")

> abline(v = 0, col = "grey")

> segments(x0 = lowerft2[plotorder4ft], x1 = upperft2[plotorder4ft], y0 = locbarsft)

> mtext("Labor Candidate, \n Unopposed", side = 3, line = 1, font = 3, cex = 0.8)

> dev.print(file = "figure5.pdf",device = pdf, width = 7.5, height = 4)
RStudioGD 
        2 

> ### constituencies by tariff reform and party (fig 6)
> dev.off()
null device 
          1 

> rti_party = prop.table(table(britcon$trade.gen, britcon$party2), margin = 2)[ , c(2,9,10,11)]

> rti_party_abs = table(britcon$trade.gen, britcon$party2)[ , c(2,9,10,11)]

> shadesOfGrey <- colorRampPalette(c("grey0", "grey100"))

> threeGreys <- shadesOfGrey(3)

> fourGreys <- shadesOfGrey(4)

> par(mar = c(4,6,1,1)+0.2)

> pfiii=barplot(rti_party_abs[ , c(4,2,1,3)], beside = T, horiz = T, las = 1, xlim = c(0, 250), col = threeGreys, names.arg = c("Liberal \n Unionist", .... [TRUNCATED] 

> mtext("Number of constituencies", side = 1, line = 2.5)

> legend(50, 8, legend = c("Free Trade", "Neutral / No position", "Tariff reform"), fill = rev(threeGreys), bty = "n")

> dev.print(device = pdf, file = "figure6.pdf", width = 7.5, height = 4.5)
RStudioGD 
        2 

> ## main table models: 
> ##  cluster errors by constituency type 
> 
> ## 0. trade interests only
> m0f.type = glm(aye ~  trade.gen.f, family=binomi .... [TRUNCATED] 

> m0f.t.vcov<-cluster.vcov(m0f.type, britcon$ctype)

> m0f.t.coef = coeftest(m0f.type, m0f.t.vcov)

> ## 1. pelling controls (all categorical)
> m1f.type = glm(aye ~ trade.gen.f + military + industrial.f + d.type + lb.socec, family=binomial(link = "l ..." ... [TRUNCATED] 

> m1f.t.vcov<-cluster.vcov(m1f.type, britcon$ctype)

> m1f.t.coef = coeftest(m1f.type, m1f.t.vcov)

> ## 2. plus party
> m2f.type = glm(aye ~ trade.gen.f + military + industrial.f + d.type + lb.socec + party2, family=binomial(link = "logit"), data =  .... [TRUNCATED] 

> m2f.t.vcov<-cluster.vcov(m2f.type, britcon$ctype)

> m2f.t.coef = coeftest(m2f.type, m2f.t.vcov)

> ## 3. plus region 
> 
> m3f.type = glm(aye ~  trade.gen.f + military + industrial.f + d.type + lb.socec + region2, family=binomial(link = "logit"),  .... [TRUNCATED] 

> m3f.t.vcov<-cluster.vcov(m3f.type, britcon$ctype)

> m3f.t.coef = coeftest(m3f.type, m3f.t.vcov)

> # party and region controls
> m4f.type = glm(aye ~ trade.gen.f + military + industrial.f + d.type + lb.socec + party2 + region2, family=binomial(lin .... [TRUNCATED] 

> m4f.t.vcov<-cluster.vcov(m4f.type, britcon$ctype)

> m4f.t.coef =coeftest(m4f.type, m4f.t.vcov)

> ## 5. party-region fes
> m5f.type = glm(aye ~ trade.gen.f + lb.socec + industrial.f + d.type + military + rp, data = britcon, family=binomial(link = .... [TRUNCATED] 

> m5f.t.vcov<-cluster.vcov(m5f.type, britcon$ctype, force_posdef = T)

> m5f.t.coef=coeftest(m5f.type, m5f.t.vcov)

> ## 6. limited to split delegations, party and region
> m6f.type = glm(aye ~ trade.gen.f + military + industrial.f + d.type + lb.socec + party2 + reg .... [TRUNCATED] 

> m6f.t.vcov<-cluster.vcov(m6f.type, britcon$ctype[which(britcon$rp == "Southwest-Liberal" | britcon$rp == "South East-Liberal" | britcon$rp == "South ..." ... [TRUNCATED] 

> m6f.t.coef=coeftest(m6f.type, m6f.t.vcov)

> ## 7. limited to split delegations, no party, no region 
> m7f.type = glm(aye ~ trade.gen.f + military + industrial.f + d.type + lb.socec, data = br .... [TRUNCATED] 

> m7f.t.vcov<-cluster.vcov(m7f.type, britcon$ctype[which(britcon$rp == "Southwest-Liberal" | britcon$rp == "South East-Liberal" | britcon$rp == "South ..." ... [TRUNCATED] 

> m7f.t.coef=coeftest(m7f.type, m7f.t.vcov)

> ## Table 4:
> 
> stargazer(m0f.type, m1f.type, m3f.type, m2f.type, m4f.type, m7f.type, m6f.type
+           ,  se = list(m0f.t.coef[,2], m1f.t.coef[ .... [TRUNCATED] 

Determinants of MPs' votes on the the Third Reading of the 1909 Finance Bill.
--------------------------------------------------------------------------------------------------------------------
                                                                  `Aye' vote                                        
                              Model 1      Model 2      Model 3      Model 4      Model 5      Model 6     Model 7  
--------------------------------------------------------------------------------------------------------------------
Trade: free trade             2.29***      2.45***       1.63**      3.64***      2.86***       1.86*     18.49***  
                              (0.66)        (0.77)       (0.67)       (0.87)       (0.95)      (0.97)      (1.33)   
Trade: neutral                1.45**       2.02***      1.61***      1.53***        1.86       2.32***      1.46*   
                              (0.62)        (0.73)       (0.55)       (0.48)       (1.16)      (0.67)      (0.78)   
Mixed socio-economic                       1.30***      1.56***        0.30         0.36        0.74        0.42    
                                            (0.45)       (0.49)       (1.22)       (1.36)      (1.12)      (1.54)   
Working class                              1.73***      1.85***        0.49         0.44        0.89        0.02    
                                            (0.49)       (0.49)       (0.97)       (1.11)      (1.10)      (1.28)   
Part-industrial                            0.87***      1.12***        0.37         0.78       1.01**       0.84    
                                            (0.26)       (0.26)       (0.84)       (0.97)      (0.45)      (0.83)   
Industrial                                 1.39***      2.07***        1.30        1.73*        0.98        1.32    
                                            (0.33)       (0.47)       (1.15)       (1.03)      (0.73)      (1.25)   
Military                                    -0.64       -1.08**       -1.38        -1.67*       -0.64      -1.69*   
                                            (0.42)       (0.43)       (0.94)       (0.98)      (0.53)      (0.97)   
County (more rural)                         -0.03        -0.04        -1.26        -0.96        0.66        -0.37   
                                            (0.32)       (0.31)       (0.95)       (1.30)      (0.66)      (1.31)   
Includes region                 No            No          Yes           No          Yes          No          Yes    
Includes party                  No            No           No          Yes          Yes          No          Yes    
N                               500          500          500          500          500          169         169    
Log Likelihood                -266.68      -234.90      -217.33       -41.33       -38.20      -82.97      -30.30   
AIC                           539.36        487.81       470.66       108.66       120.40      183.93       88.60   
--------------------------------------------------------------------------------------------------------------------
***p < .01; **p < .05; *p < .1                                                                                      
Standard errors clustered by constituency type.                                                                     
Omitted categories are: protectionist trade, upper class socioceonomic, non-industrial.                             
`Split delegation' models include only MPs from parties and regions which included both `aye' and `no' votes.       

> #### Figure 7
> 
> m3f.sim <- rmvnorm(1000, m3f.type$coef, m3f.t.vcov)

> freetrade.3cx <- c(1, 0,1,0,0,0,0,0,0,0,0,0, 0, 0, 0, 0, 0, 0) # liberal, not military, non-industrial, upper class borough; free trade interests

> protection.3cx <- c(1, 0,0,0,0,0,0,0,0,0,0,0, 0, 0, 0, 0, 0, 0)  # liberal, not military, non-industrial, upper class borough; protectionist trade i .... [TRUNCATED] 

> pp.3freetrade <- numeric(1000)

> for(j in 1:1000) {
+   pp.3freetrade[j] <- t(as.matrix(freetrade.3cx)) %*% m3f.sim[j,]
+ }

> pe.3ft <- mean(inv.logit(pp.3freetrade))

> lo.3ft <- quantile(inv.logit(pp.3freetrade), .025)

> hi.3ft <- quantile(inv.logit(pp.3freetrade), .975)

> pp.3protection <- numeric(1000)

> for(j in 1:1000) {
+   pp.3protection[j] <- t(as.matrix(protection.3cx)) %*% m3f.sim[j,]
+ }

> pe.3pr <- mean(inv.logit(pp.3protection))

> lo.3pr <- quantile(inv.logit(pp.3protection), .025)

> hi.3pr <- quantile(inv.logit(pp.3protection), .975)

> # for error bars
> lo90.3ft <- quantile(inv.logit(pp.3freetrade), .05)

> hi90.3ft <- quantile(inv.logit(pp.3freetrade), .95)

> lo90.3pr <- quantile(inv.logit(pp.3protection), .05)

> hi90.3pr <- quantile(inv.logit(pp.3protection), .95)

> par(mar = c(4,6,1,1)+0.2)

> brep = barplot(height = c(pe.3ft, pe.3pr), horiz = T, xlim = c(-0.05, 1.05), xlab = "Expected probability of `aye'", col = fourGreys[3], names.arg = .... [TRUNCATED] 

> segments(lo.3ft, brep[1], hi.3ft, brep[1], lty=3)

> segments(lo.3pr, brep[2], hi.3pr, brep[2], lty=3)

> points(x = c(lo.3ft,  hi.3ft), y = c(brep[1],brep[1]), pch = 18)

> points(x = c(lo.3pr,  hi.3pr), y = c(brep[2],brep[2]), pch = 18)

> dev.print(device = pdf, file = "figure7.pdf", width = 5.5, height = 1.669875)
RStudioGD 
        2 

> #sink()
